import request from '@/utils/request';

export async function queryRule(params) {
  const limit = params.pageSize;
  const page = params.current;
  const my_params = {
    limit: limit,
    page: page,
  };
  Object.assign(params, my_params);
  delete params.current;
  delete params.pageSize;
  return request(`/position/list`, {
    params,
  });
}
export async function removeRule(params) {
  return request(`/position/${params}`, {
    method: 'DELETE',
  });
}
export async function addRule(params) {
  return request('/position', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
export async function updateRule(params) {
  return request('/position', {
    method: 'PUT',
    data: {
      ...params,
    },
  });
}
export async function queryStore(params) {
  return request('store/store/list', {
    params,
  });
}
export async function queryPosition(params) {
  return request(`/position/${params}`, );
}
export async function getDictionary(params, id) {
  return request(id ? `common/dictionary/list/?module=${params}&parentId=${id}` : `common/dictionary/list/?module=${params}`);
}
